import allure
from appium.webdriver.common.appiumby import AppiumBy

from base.xueqiu_app import XueQiu


class Manager(XueQiu):
    _manage = AppiumBy.XPATH, "//*[@resource-id='com.xueqiu.android:id/stock_list']//*[@class='android.widget.LinearLayout'][4]//*[@resource-id='com.xueqiu.android:id/iv_nesting_portfolio_list_management_item_top']"
    _sort = AppiumBy.ID, 'com.xueqiu.android:id/tv_nesting_portfolio_fragment_management_first_tab_name'

    @allure.step('自选管理本页管理')
    def manage_page(self):
        # 管理本页排序
        self.find_ele_click(self._manage)
        res = self.find_ele(self._sort)
        self.screen()
        return res
